use std::io;

fn main() {
    let x = 2.0; // f64

    let y: f32 = 3.0; // f32

    // addition
    let sum = 5 + 10;

    // subtraction
    let difference = 95.5 - 4.3;

    // multiplication
    let product = 4 * 30;

    // division
    let quotient = 56.7 / 32.2;
    let truncated = -5 / 3; // result is -1
    println!("{}", truncated);

    // remainder
    let remainder = 43 % 5;
    println!("remainder: {}", remainder);

    let t = true;
    let f: bool = false;

    let c = 'z';
    let z: char = 'ℤ';
    println!("{}", z);
    let heart_eyed_cat = '😻';
    println!("{}", heart_eyed_cat);

    let tup: (i32, f64, u8) = (500, 6.4, 1);
    let (x, y, z) = tup;
    println!("the value of y: {}", y);

    println!("{}, {}, {}", tup.0, tup.1, tup.2);

    let a = [1, 2, 3, 4, 5];
    let months = ["January", "February", "March", "April", "May", "June", "July",
              "August", "September", "October", "November", "December"];
    let a: [i32; 5] = [1,2,3,4,5];
    println!("{:?}", a);
    let a = [3; 5];
    println!("{:?}", a);
    println!("{}, {}", a[0], a[1]);

    println!("Please enter an array index.");
    let mut index = String::new();
    io::stdin().read_line(&mut index)
                .expect("failed to read line");
    let index: usize = index.trim().parse().expect("not a number");

    println!("a[{}] = {}", index, a[index]);


}
